package main

import (
	"context"
	"fmt"
	"github.com/go-redis/redis/v8"
)

var (
	connectAddr = "redis-aliyun-dev:9736"
	pwd         string
	client      *redis.Client
)

func init() {
	client = redis.NewClient(&redis.Options{
		Addr:       connectAddr,
		Password:   pwd,
		DB:         0,
		PoolSize:   30,
		MaxRetries: 5,
	})

	if err := client.Ping(context.Background()).Err(); err != nil {
		panic(err)
	}
}

func main() {
	var (
		ctx = context.Background()
	)
	s := client.HMGet(ctx, "signal:online", "BSC2100013F00514")
	fmt.Println(s.Result())
	fmt.Println(s.String())
}
